package com.lxmes.business.service.impl;

import java.util.List;
import com.lxmes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lxmes.business.mapper.CcWarehouserecordMapper;
import com.lxmes.business.domain.CcWarehouserecord;
import com.lxmes.business.service.ICcWarehouserecordService;

/**
 * 出入库流水Service业务层处理
 * 
 * @author 张志煜
 * @date 2022-07-03
 */
@Service
public class CcWarehouserecordServiceImpl implements ICcWarehouserecordService 
{
    @Autowired
    private CcWarehouserecordMapper ccWarehouserecordMapper;

    /**
     * 查询出入库流水
     * 
     * @param id 出入库流水主键
     * @return 出入库流水
     */
    @Override
    public CcWarehouserecord selectCcWarehouserecordById(Long id)
    {
        return ccWarehouserecordMapper.selectCcWarehouserecordById(id);
    }

    /**
     * 查询出入库流水列表
     * 
     * @param ccWarehouserecord 出入库流水
     * @return 出入库流水
     */
    @Override
    public List<CcWarehouserecord> selectCcWarehouserecordList(CcWarehouserecord ccWarehouserecord)
    {
        return ccWarehouserecordMapper.selectCcWarehouserecordList(ccWarehouserecord);
    }

    /**
     * 新增出入库流水
     * 
     * @param ccWarehouserecord 出入库流水
     * @return 结果
     */
    @Override
    public int insertCcWarehouserecord(CcWarehouserecord ccWarehouserecord)
    {
        ccWarehouserecord.setCreateTime(DateUtils.getNowDate());
        return ccWarehouserecordMapper.insertCcWarehouserecord(ccWarehouserecord);
    }

    /**
     * 修改出入库流水
     * 
     * @param ccWarehouserecord 出入库流水
     * @return 结果
     */
    @Override
    public int updateCcWarehouserecord(CcWarehouserecord ccWarehouserecord)
    {
        ccWarehouserecord.setUpdateTime(DateUtils.getNowDate());
        return ccWarehouserecordMapper.updateCcWarehouserecord(ccWarehouserecord);
    }

    /**
     * 批量删除出入库流水
     * 
     * @param ids 需要删除的出入库流水主键
     * @return 结果
     */
    @Override
    public int deleteCcWarehouserecordByIds(Long[] ids)
    {
        return ccWarehouserecordMapper.deleteCcWarehouserecordByIds(ids);
    }

    /**
     * 删除出入库流水信息
     * 
     * @param id 出入库流水主键
     * @return 结果
     */
    @Override
    public int deleteCcWarehouserecordById(Long id)
    {
        return ccWarehouserecordMapper.deleteCcWarehouserecordById(id);
    }

    @Override
    public List<CcWarehouserecord> selectCcWarehouserecordListDp(CcWarehouserecord ccWarehouserecord) {
        ccWarehouserecord.setBeginTime(DateUtils.getDate());
        return ccWarehouserecordMapper.selectCcWarehouserecordListDp(ccWarehouserecord);
    }

    @Override
    public List<CcWarehouserecord> mobileWarehouserecordList(CcWarehouserecord ccWarehouserecord) {
        return ccWarehouserecordMapper.mobileWarehouserecordList(ccWarehouserecord);
    }
}
